<!--{include header}-->

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="content">
    <div id="deal-buy" class="box">
 
        <div class="box-content">
            <div class="head"><h2>您的订单</h2></div>
            <div class="sect">
                <table class="order-table">
                

                
                
                
                    <tr>
                        <th class="deal-buy-desc">项目名称</th>
                        <th class="deal-buy-quantity">数量</th>
                        <th class="deal-buy-multi"></th>
                        <th class="deal-buy-price">价格</th>
                        <th class="deal-buy-equal"></th>
                        <th class="deal-buy-total">总价</th>
                    </tr>
                    
                    
                                    <!--{if $team_num > 1}-->
	  <!--{loop $order_list $tindex $one}-->
						<td class="pname">${get_team_title($one['team_id'])}</td>
	<td>&nbsp;&nbsp;{$one['quantity']}&nbsp;&nbsp;</td>
	<td>x</td>
	<td class="deal-buy-price" id="deal-buy-price"><span class="money">{$currency}</span>${moneyit($one['price'])}</td>
	<td>=</td>
	<td class="deal-buy-total" id="deal-buy-total"><strong>&yen;${moneyit($one['price']*$one['quantity'])}</strong></td>
				</tr>
	 <!--{/loop}-->           
<!--{else}-->                   
		  <tr>
						<td class="pname">{$team['title']}</td>
	<td>&nbsp;&nbsp;{$order['quantity']}&nbsp;&nbsp;</td>
	<td>x</td>
	<td class="deal-buy-price" id="deal-buy-price"><span class="money">{$currency}</span>${moneyit($order['price'])}</td>
	<td>=</td>
	<td class="deal-buy-total" id="deal-buy-total"><strong>&yen;${moneyit($order['price']*$order['quantity'])}</strong></td>
				</tr>             
<!--{/if}--> 
                    
                    
                    
                    
                  
                
					<!--{if $order['card']>0}-->
				   <tr id="cardcode-row">
						<td class="deal-buy-desc">代金券：<span id="cardcode-row-n">{$order['card_id']}</span></td>
						<td class="deal-buy-quantity"></td>
						<td class="deal-buy-multi"></td>

						<td class="deal-buy-price"><span class="money">{$currency}</span>${moneyit($order['card'])}</td>
						<td class="deal-buy-equal">=</td>
						<td class="deal-buy-total">-<span class="money">¥</span><span id="cardcode-row-t">{$order['card']}</span></td>
					</tr>
					<!--{/if}-->

					<tr class="order-total">
                        <td class="deal-buy-desc"><strong>应付总额：</strong></td>
                        <td class="deal-buy-quantity"></td>
                        <td class="deal-buy-multi"></td>
                        <td class="deal-buy-price"></td>
                        <td class="deal-buy-equal">=</td>
                        <td class="deal-buy-total"><span class="money">{$currency}</span>{$order['origin']}</td>
                    </tr>
                </table>
				<div class="paytype">
                <form action="/order/pay.php" method="post" class="validator"  onSubmit="return count()">
				<div class="order-check-form ">
                	<div class="order-pay-credit">
						<h3>您的积分</h3>
						<p>积分余额：<strong>${moneyit($login_user['score'])}</strong> 
                        <!--{if $login_user['score']>0}-->
                        	使用积分<input type="text" name="point" onChange="count();" style="width: 80px; min-width: 60px;height: 25px;text-align:center; border:1px #cccac6 solid;" value="0"/>
                  <span style="font-size:12px;font-family:'宋体';color:#CCC;">一个积分抵一元使用</span>
                        <!--{/if}--></p>
						
					</div>
					<div class="order-pay-credit">
						<h3>您的余额</h3>
						<p>账户余额：<strong><span class="money">{$currency}</span>${moneyit($login_user['money'])}</strong>
                        
                        <!--{if $login_user['money']>0}-->
                        使用余额：
                  	<input type="text" name="money" onChange="count();" style="width: 80px; min-width: 60px;height: 25px;text-align:center; border:1px #cccac6 solid;" value="0"/>
                       <!--{/if}--></p>
						<h3>还需支付：<strong style="color:#2bb8aa;"><span id="pay_money">{$currency}{$order['origin']}</span></strong></h3>
                         <input type="hidden" name="online_pay" value="{$order['origin']}" />
					</div>
				
					
				<!--{if false==$creditonly && false==$credityes &&empty($_SESSION['ali_token'])}-->
                <div id="payment">
                	<div>请选择支付方式：</div>
					<ul class="typelist">
					
                    <li><input id="check-alipay" type="radio" name="payway" value="alipay" checked="checked"/>
                    <label for="check-alipay" class="alipay">支付宝交易，推荐淘宝用户使用</label></li>
                
                    <li><input id="check-wxpay" type="radio" name="payway" value="wxpay"  />
						<label for="check-wxpay" class="wxpay">微信扫码支付,请使用微信扫码</label></li>
					</ul>

                </div>
                
                <!--{/if}-->

					<div class="clear"></div>
					<p class="check-act">
                    <input type="hidden" name="paytype" value="credit" />
					<input type="hidden" name="order_id" value="{$order['id']}" />
					<input type="hidden" name="team_id" value="{$order['team_id']}" />
					<input type="hidden" name="cardcode" value="" />
					<input type="hidden" name="quantity" value="{$order['quantity']}" />
					<input type="hidden" name="address" value="{$order['address']}" />
					<input type="hidden" name="express" value="{$order['express']}" />
					<input type="hidden" name="remark" value="{$order['remark']}" />
					<input type="submit" value="确认订单，付款" class="formbutton" />
					<!--{if false==$credityes}-->
					<input type="button" value="确认订单，以后再付款" class="formbutton" onclick="location.href='index.php';" />
					<!--{/if}-->
                    
                    <!--{if $team_num > 1}-->
                    <a href="/cart/index.php" style="margin-left:1em;">返回修改订单</a>
                    <!--{else}-->
                    <a href="/team/buy.php?id={$order['team_id']}" style="margin-left:1em;">返回修改订单</a>
                    <!--{/if}-->
					</p>
            </div>
            </form>
                    <script type="application/javascript">
$(document).ready(function() {
	var user_point=parseFloat({$login_user['score']});
	var user_money=parseFloat({$login_user['money']});
	var origin=parseFloat({$order['origin']});
	if(user_point>0){
		if(user_point>0 && user_point<=origin){ $("input[name='point']").val(user_point);}
		if(user_point>origin){$("input[name='point']").val(origin);}
	}
	if(user_money>0){
		var left=origin;
		var point=parseFloat($("input[name='point']").val());
		if(point) left -=point;
		if(user_money>0 && user_money<=left){ $("input[name='money']").val(user_money);}
		if(user_money>left){$("input[name='money']").val(left);}
	}
     count();
  });
function count(){
	var user_point=parseFloat({$login_user['score']});
	var user_money=parseFloat({$login_user['money']});
	var origin=parseFloat({$order['origin']});
	var point=0;
	var money=0;
	if(user_point>0){
		var point=parseFloat($("input[name='point']").val());
		if(point<0 || point>user_point || point>origin){
			alert("积分输入值不合格！");
			return false;
		}
	}
	if(user_money>0){
		var money=parseFloat($("input[name='money']").val());
		if(money<0 || money>user_money || money>origin-point){
			alert("余额输入值不合格！");
			return false;
		}
	}
	
	var left=parseFloat(origin);
	if(point>0) left -=parseFloat(point);
	if(money>0) left -=parseFloat(money);
	var left=left.toFixed(2);
	//$("input[name='pay_point']").val(point);
	if(left>0){
		$("#pay_money").html("￥"+left);
		$("input[name='online_pay']").val(left);
		$("#payment").show();
		var paytype=$("input[name='payway']:checked").val();
		$("input[name='paytype']").val(paytype);
	}else{
		$("#pay_money").html("￥0");
		$("input[name='online_pay']").val(0);
		$("input[name='paytype']").val("credit");
		$("#payment").hide();
	}
	return true;
}
</script>
                </div>
                </div>
                </div>
                </div>
                </div>
					<div id="sidebar">
					<!--{if !$order['card_id']}-->
					<!--{include block_side_card}-->
					<!--{/if}-->
					</div>
                </div> <!-- bd end -->
                </div> <!-- bdw end -->

					<!--{include footer}-->
